emit the closed signal.
authorJonathan Blandford <jrb@redhat.com>
Wed, 10 Nov 1999 21:06:40 +0000 (21:06 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Wed, 10 Nov 1999 21:06:40 +0000 (21:06 +0000)
1999-11-10  Jonathan Blandford  <jrb@redhat.com>

* src/gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): emit the
closed signal.

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-loader.c
gdk-pixbuf/io-gif.c
gtk/gdk-pixbuf-loader.c

index 89733b2212cdcdf245272d6862fdf70d7107db2f..e7a9ecde8f0c51bc23b637a28a06b86e3756de9c 100644 (file)
@@ -1,5 +1,8 @@
 1999-11-10  Jonathan Blandford  <jrb@redhat.com>
 
+       * src/gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): emit the
+       closed signal.
+
        * src/io-ras.c (OneLineMapped_file): Now can handle indexing
        correctly.  Patch from Arjan to do so.
 
index 73093c6cf0ccebebc3a0697ed0504d92014ee004..627d8dcd71044b5dc65084151672793efb455de0 100644 (file)
@@ -403,4 +403,11 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader)
                (* priv->image_module->stop_load) (priv->context);
 
        priv->closed = TRUE;
+
+       gtk_signal_emit (GTK_OBJECT (loader),
+                        pixbuf_loader_signals[CLOSED],
+                        x, y,
+                        /* sanity check in here.  Defend against an errant loader */
+                        MIN (width, gdk_pixbuf_get_width (priv->pixbuf)),
+                        MIN (height, gdk_pixbuf_get_height (priv->pixbuf)));
 }
index f1dcc6e9021faba9df6866588021a17557d6a475..005bb907f0859e494a9af3ed245397a971b647b4 100644 (file)
@@ -99,6 +99,9 @@ typedef struct _Gif89 Gif89;
 struct _Gif89
 {
        int transparent;
+       int delay_time;
+       int input_flag;
+       int disposal;
 };
 
 typedef struct _GifContext GifContext;
@@ -108,6 +111,7 @@ struct _GifContext
        unsigned int width;
        unsigned int height;
        CMap color_map;
+       CMap frame_color_map;
        unsigned int bit_pixel;
        unsigned int color_resolution;
        unsigned int background;
@@ -1002,6 +1006,26 @@ gif_main_loop (GifContext *context)
        return retval;
 }
 
+static GifContext *
+new_context (void)
+{
+       GifContext *context;
+
+       context = g_new (GifContext, 1);
+       context->pixbuf = NULL;
+       context->file = NULL;
+       context->state = GIF_START;
+       context->prepare_func = NULL;
+       context->update_func = NULL;
+       context->user_data = NULL;
+       context->buf = NULL;
+       context->amount_needed = 0;
+       context->gif89.transparent = -1;
+       context->gif89.delay_time = -1;
+       context->gif89.input_flag = -1;
+       context->gif89.disposal = -1;
+       return context;
+}
 /* Shared library entry point */
 GdkPixbuf *
 image_load (FILE *file)
@@ -1010,12 +1034,8 @@ image_load (FILE *file)
 
        g_return_val_if_fail (file != NULL, NULL);
 
-       context = g_new (GifContext, 1);
+       context = new_context ();
        context->file = file;
-       context->pixbuf = NULL;
-       context->state = GIF_START;
-       context->prepare_func = NULL;
-       context->update_func = NULL;
 
        gif_main_loop (context);
 
@@ -1032,15 +1052,11 @@ image_begin_load (ModulePreparedNotifyFunc prepare_func,
 #ifdef IO_GIFDEBUG
        count = 0;
 #endif
-       context = g_new (GifContext, 1);
+       context = new_context ();
        context->prepare_func = prepare_func;
        context->update_func = update_func;
        context->user_data = user_data;
-       context->file = NULL;
-       context->pixbuf = NULL;
-       context->state = GIF_START;
-       context->buf = NULL;
-       context->amount_needed = 0;
+
        return (gpointer) context;
 }
 
index 73093c6cf0ccebebc3a0697ed0504d92014ee004..627d8dcd71044b5dc65084151672793efb455de0 100644 (file)
@@ -403,4 +403,11 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader)
                (* priv->image_module->stop_load) (priv->context);
 
        priv->closed = TRUE;
+
+       gtk_signal_emit (GTK_OBJECT (loader),
+                        pixbuf_loader_signals[CLOSED],
+                        x, y,
+                        /* sanity check in here.  Defend against an errant loader */
+                        MIN (width, gdk_pixbuf_get_width (priv->pixbuf)),
+                        MIN (height, gdk_pixbuf_get_height (priv->pixbuf)));
 }